// m4aSharp.h

#pragma once

#include "Atom.h"
#include "TrackData.h"
#include "AtomicParsley.h"

namespace m4aSharp 
{
	public ref class m4aFile
	{
	public:
		m4aFile(String^ path);

		Atom^ GetAtom(String^ atomPath);

		property IDictionary<String^, Atom^>^ Atoms
		{
			IDictionary<String^, Atom^>^ get()
			{
				return _atoms;
			}
		}

		property Byte TotalTracks
		{
			Byte get()
			{
				return _totalTracks;
			}
		}

		property String^ Path
		{
			String^ get()
			{
				return _path;
			}
		}

		property TrackData^ Track
		{
			TrackData^ get()
			{
				return _trackData;
			}
		}

		void Load();

	private:
		static Atom^ CreateAtom(AtomicParsley& parsley, AtomicInfo* info);

		IDictionary<String^, Atom^>^ _atoms;
		String^ _path;
		Byte _totalTracks;
		TrackData^ _trackData;
	};
}
